package my.edu.model.bills.fund.entity.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import jakarta.validation.groups.Default;
import lombok.Data;
import my.edu.common.validate.groups.Insert;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
@Data
public class IncomeDTO {
    @Null(message = "id必须为空", groups = {Insert.class})
    @NotNull(message = "id不能为空", groups = {Default.class})
    private Long id;
    @NotBlank(message = "编号不能为空", groups = {Default.class})
    private String orderNo;
    @NotNull(message = "日期不能为空", groups = {Insert.class})
    private LocalDate orderDate;
    private Long customerId;
    private String customerName;
    private Long salespersonId;
    private String salespersonName;
    private LocalDate receiptDate;//收款到账日期
    private String remark;
    private Integer isAudited;
    private Long settlementAccountId;
    private String settlementAccountName;
    @Min(value = 0, message = "金额必须大于0", groups = {Insert.class})
    private BigDecimal receiptAmount;//总金额
    private BigDecimal debtAmount;
    @Min(value = 0, message = "金额必须大于0", groups = {Insert.class})
    private BigDecimal amountReceived;//已经收款金额
    private Long auditorId;
    private String auditorName;
    private String receiptStatus;
    private String paymentTerms;
    private String accountingStatus;

    @Valid
    @NotEmpty(message = "采购明细不能为空", groups = {Insert.class})
    private List<InComeDetailDTO> incomeDetailDTOList;
}
